package org.pasta.bean;

import java.util.List;

import org.pasta.common.AbstractBean;
import org.pasta.data.Product;
import org.pasta.query.ProductQuery;
import org.pasta.service.ProductServices;

public class ProductBean extends AbstractBean implements ProductServices {
	
	private ProductQuery productQuery;

	public ProductBean(List queryList) {
		super(queryList);
		if( queryList != null && queryList.size() > 0 ){
			Object obj = queryList.get(0);
			if( obj instanceof ProductQuery ){
				productQuery = (ProductQuery)obj;
			}
		}
	}

	public List<Product> findProducts(String searchTxt) {
		// TODO Auto-generated method stub
		return productQuery.findProducts(searchTxt);
	}

	public ProductQuery getProductQuery() {
		return productQuery;
	}

	public void setProductQuery(ProductQuery productQuery) {
		this.productQuery = productQuery;
	}

}
